<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddTypeAndSourceIdToOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mckj_order', function (Blueprint $table) {
            $table->smallInteger('type')->default(1)->comment('订单类型（1：普通洗车订单，2：购买卡订单，3：卡洗车订单,4:优惠券洗车）');
            $table->integer('source_id')->default(0)->comment('卡券产品Id或用户卡券Id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mckj_order', function (Blueprint $table) {
            $table->dropColumn('type');
            $table->dropColumn('source_id');
        });
    }
}
